<!DOCTYPE html> 
<html> 
	<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1"> 
	<title>jQuery Mobile Docs - Grouped Buttons</title> 
	<link rel="stylesheet"  href="../../jquery.mobile-1.0.min.css" /> 
	<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/> 
	<script src="../../jquery.js"></script>
	<script src="../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
	<script src="../_assets/js/jqm-docs.js"></script>
	<script src="../../jquery.mobile-1.0.min.js"></script>
</head>
<body> 

<div data-role="page" class="type-interior">

	<div data-role="header" data-theme="f">
		<h1>Grouped buttons</h1>
		<a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
	</div><!-- /header -->

	<div data-role="content">
		<div class="content-primary">
		
		<p>Occasionally, you may want to visually group a set of buttons together to form a single block that looks contained like a navigation component. To get this effect, wrap a set of buttons in a container with the <code> data-role="controlgroup"</code> attribute &mdash; the framework will create a vertical button group, remove all margins and drop shadows between the buttons, and only round the first and last buttons of the set to create the effect that they are grouped together. </p>
<pre><code>
&lt;div data-role=&quot;controlgroup&quot;&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot;&gt;Yes&lt;/a&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot;&gt;No&lt;/a&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot;&gt;Maybe&lt;/a&gt;
&lt;/div&gt;
</code></pre>

		<p>By default, grouped buttons are presented as a vertical list:</p>
		
		<div data-role="controlgroup">
			<a href="index.html" data-role="button">Yes</a>
			<a href="index.html" data-role="button">No</a>
			<a href="index.html" data-role="button">Maybe</a>
		</div>
		
		<p>By adding the <code>data-type="horizontal"</code> attribute to the <code>controlgroup</code> container, you can swap to a horizontal-style group that floats the buttons side-by-side and sets the width to only be large enough to fit the content. (Be aware that these will wrap to multiple lines if the number of buttons or the overall text length is too wide for the screen.)
		
		<p>Horizontal grouped buttons:</p>
		<div data-role="controlgroup" data-type="horizontal">
			<a href="index.html" data-role="button">Yes</a>
			<a href="index.html" data-role="button">No</a>
			<a href="index.html" data-role="button">Maybe</a>
		</div>
			
		<p>Horizontal grouped buttons with icons:</p>
		<div data-role="controlgroup" data-type="horizontal" >
			<a href="index.html" data-role="button" data-icon="plus">Add</a>
			<a href="index.html" data-role="button" data-icon="delete">Delete</a>
		</div>
		
		<p>Horizontal grouped buttons, icon only:</p>
		<div data-role="controlgroup" data-type="horizontal" >
			<a href="index.html" data-role="button" data-icon="arrow-u" data-iconpos="notext">Up</a>
			<a href="index.html" data-role="button" data-icon="arrow-d" data-iconpos="notext">Down</a>
			<a href="index.html" data-role="button" data-icon="delete" data-iconpos="notext">Delete</a>
		</div>
		
		
	</div><!--/content-primary -->		
	
	<div class="content-secondary">
		
		<div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
			
				<h3>More in this section</h3>
				
				<ul data-role="listview" data-theme="c" data-dividertheme="d">
				
					<li data-role="list-divider">Buttons</li>
					<li><a href="buttons-types.html">Button basics</a></li>
					<li><a href="buttons-icons.html">Button icons</a></li>
					<li><a href="buttons-inline.html">Inline buttons</a></li>
					<li data-theme="a"><a href="buttons-grouped.html">Grouped buttons</a></li>
					<li><a href="buttons-themes.html">Theming buttons</a></li>
	
				</ul>
		</div>
	</div>		

</div><!-- /content -->

<div data-role="footer" class="footer-docs" data-theme="c">
		<p>&copy; 2011 The jQuery Project</p>
</div>
	
</div><!-- /page -->

</body>
</html>